﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/include.jsp"%>
<link rel="stylesheet" href="${ctx}/ztree/css/zTreeStyle/zTreeStyle.css" />
<script src="${ctx}/jquery/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="${ctx}/ztree/js/jquery.ztree.all.min.js" type="text/javascript"></script>

<script type="text/javascript">
		$.post(
		"${ctx}/tree/DeptTree.do",	
		{pId:"131"},
		function(msg){
			var setting = {
					data: {
						simpleData: {
							enable: true
						}
					},
					callback: {
						onClick:function zTreeOnClick(event, treeId, treeNode) {
							if(treeNode.name!='逸天教育科技有限公司'){
								$.post(
										"${ctx}/tree/getDeptData.do?id="+treeNode.id,
										function(msg){
											if(msg=="true"){
												parent.workareaFrame.location = "./list.jsp";
											}
										},
										"text"
								)
							}else{
								return;
								}
						    
						},
							
					}
				}; 
			 var zNodes =msg;
			$(document).ready(function(){
				$.fn.zTree.init($("#permission_tree"), setting, zNodes);
			});
		},
		"json"
		) 
		/*  var zNodes =[
			{id:"1",pId:"0",name:"逸天教育科技有限公司",uri:"${ctx}/dept/workarea.jsp",open:true},
			{"id":"11","pId":"1","name":"管理部","uri":"${ctx}/dept/son/guanli/list.jsp"},
			{id:"12",pId:"1",name:"讲师部",uri:"${ctx}/dept/son/jiangshi/list.jsp"},
			{id:"13",pId:"1",name:"学管部",uri:"${ctx}/dept/son/xueguan/list.jsp"},
			{id:"14",pId:"1",name:"招生部",uri:"${ctx}/dept/son/zhaosheng/list.jsp"},
			{id:"15",pId:"1",name:"后勤部",uri:"${ctx}/dept/son/houqin/list.jsp"},
			{id:"16",pId:"1",name:"财务部",uri:"${ctx}/dept/son/caiwu/list.jsp",open:true},
			{id:"161",pId:"16",name:"财务北京分部"},
			{id:"161",pId:"16",name:"财务新乐分部"}
		];  */
			
		</script>
<ul id="permission_tree" class="ztree">
</ul>
